<?php



class Widget_widget_tab_content_Controller extends Base_Controller {

	public $restful = true;

    public function __construct()
    {
        parent::__construct();
        //--Your Code --//
    }
	
	
	public function get_index(){

        //--FEATURED--//
        $limit = Config::get('Widget::settings.featured_count') ;
        $today = date('Y/m/d', time());
        $sql = "SELECT P.* from post P
			INNER JOIN featured F on P.id = F.post_id
			AND P.status='51'
			AND F.valid_upto >= DATE_FORMAT('{$today}','%Y-%m-%d') group by P.id order by valid_upto DESC Limit 0, $limit";
        $result = DB::query($sql);
        $data['featured'] = $result;

      
        return View::make('widget::tab_content',$data);
	}




}

